#coding:utf-8
import pymysql
import json


class operateMysql:
	def __init__(self):
		self.conn = pymysql.connect(
			host='malffffcom',
			port=3306,
			user='root',
			passwd='Zhuan!@#',
			db='testll',
			charset='utf8',
			)
		self.cur = self.conn.cursor()

	# 查询一条数据
	def search_one(self,sql):
		self.cur.execute(sql)
		result = self.cur.fetchone()
		result = json.dumps(result)
		return result


if __name__ == '__main__':
	op_mysql = operateMysql()
